package com.gooluke.spring.property;

import java.io.InputStream;
import java.util.Properties;

public class PropertyLoader {
    public static Properties loadProperties(String filePath) {
        Properties properties = new Properties();
        try (InputStream input = PropertyLoader.class.getClassLoader().getResourceAsStream(filePath)) {
            if (input == null) {
                throw new IllegalArgumentException("配置文件未找到: " + filePath);
            }
            properties.load(input);
        } catch (Exception e) {
            throw new RuntimeException("加载配置文件失败", e);
        }
        return properties;
    }
}